package com.unionpay.upyzt.example;

import com.unionpay.upyzt.param.Extra;
import com.unionpay.upyzt.param.ProductInfo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author yf.zhao
 * @version 1.0
 * @since 2020/10/29
 */
public class MockData {

    /**
     * extra内与欧元
     *
     * @return
     */
    public static Extra extra() {
        Extra extra = new Extra();
        List<ProductInfo> productInfos = new ArrayList<>(1);
        ProductInfo productInfo = new ProductInfo();
        productInfo.setOrderAmount(100L);
        productInfo.setOrderNo(Main.generateRandomOutNo());
        productInfo.setProductCount(1);
        productInfo.setProductName("SDK 测试商品名称");
        productInfos.add(productInfo);
        extra.setProductInfos(productInfos);
        return extra;
    }

    public static Map<String, Object> metadata() {
        Map<String, Object> metadata = new HashMap<>();
        metadata.put("custom_key", "这里平台可以自定义参数");
        return metadata;
    }
}
